package com.letoken.platform.app.job;

import com.letoken.platform.app.consumer.FundConsumer;
import com.letoken.platform.app.service.AppFundV2InfoService;
import com.letoken.platform.repo.app.dao.AdminFundV2ConfigMapper;
import com.letoken.platform.repo.app.dao.AppFundV2InfoMapper;
import com.letoken.platform.repo.app.po.AppFundV2Info;
import com.xxl.job.core.handler.annotation.XxlJob;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.math.BigDecimal;

@Component
@Slf4j
public class FundIncomeV2Job {
    @Resource
    AdminFundV2ConfigMapper adminFundV2ConfigMapper;

    @Autowired
    AppFundV2InfoMapper appFundV2InfoMapper;

    @Autowired
    AppFundV2InfoService appFundV2InfoService;

    @XxlJob("income")
    public  void income() {
        appFundV2InfoService.income();;
    }

    @Autowired
    RabbitTemplate rabbitTemplate;
    @XxlJob("updateWeighting")
    public void updateWeighting() {
        rabbitTemplate.convertAndSend(FundConsumer.exchange, FundConsumer.queueWeighting, new BigDecimal("21934.58994011"));
    }
}
